<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>resolve</title>
</head>
<body>
    <script>
        //作用: 快速创建 promise 实例对象
        // let p = Promise.resolve('love');
        // let p2 = Promise.resolve(false);
        //返回值是由参数值决定的, 如果参数值不是一个 promise 实例对象, 则返回的将是一个成功的 promise 实例对象, 
        //参数值就是 promise 实例对象的结果值
        // let p3 = Promise.resolve(null);
        //如果参数值是一个 promise 实例对象, 参数的状态将决定 resolve 返回值的状态
        // let p4 = Promise.resolve(new Promise((resolve, reject) => {
            // resolve('abc');
            // reject('Error');
        // }))

        let p5 = Promise.resolve(Promise.resolve(Promise.resolve('OK')));

        console.log(p5);
        
    </script>
</body>
</html>